
    #include <mpi.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    #ifndef _EXTERN_C_
    #ifdef __cplusplus
    #define _EXTERN_C_ extern "C"
    #else /* __cplusplus */
    #define _EXTERN_C_
    #endif /* __cplusplus */
    #endif /* _EXTERN_C_ */
    
    #ifdef MPICH_HAS_C2F
    _EXTERN_C_ void *MPIR_ToPointer(int);
    #endif // MPICH_HAS_C2F
    
    #ifdef PIC
    /* For shared libraries, declare these weak and figure out which one was linked
    based on which init wrapper was called.  See mpi_init wrappers.  */
    #pragma weak pmpi_init
    #pragma weak PMPI_INIT
    #pragma weak pmpi_init_
    #pragma weak pmpi_init__
    #endif /* PIC */
    
    _EXTERN_C_ void pmpi_init(MPI_Fint *ierr);
    _EXTERN_C_ void PMPI_INIT(MPI_Fint *ierr);
    _EXTERN_C_ void pmpi_init_(MPI_Fint *ierr);
    _EXTERN_C_ void pmpi_init__(MPI_Fint *ierr);
    
    
/* Customized MPI Wrapper */ 

static double start_time = 0.0;
static double end_time = 0.0;
inline void Pre_MPI(void)
{
    start_time = PMPI_Wtime();
    printf("pre_MPI\n");
}

inline void Post_MPI(enum mpi_id id)
{
    end_time = PMPI_Wtime();
    // record counter information 
    // record time
    printf("post_MPI\n");
}
#define OPER_COUNTER(op, name) { name, 0, 999999.0, 0.0, 0.0, 0.0, NULL }

enum mpi_id {
    MPI_File_write_all_begin_counter, 
    MPI_Win_post_counter, 
    MPI_Win_get_errhandler_counter, 
    MPI_File_read_counter, 
    MPI_File_get_group_counter, 
    MPI_Scan_counter, 
    MPI_Startall_counter, 
    MPI_Attr_delete_counter, 
    MPI_File_iwrite_shared_counter, 
    MPI_Comm_get_attr_counter, 
    MPI_File_get_info_counter, 
    MPI_Type_delete_attr_counter, 
    MPI_Error_class_counter, 
    MPI_Free_mem_counter, 
    MPI_Wtime_counter, 
    MPI_Info_dup_counter, 
    MPI_Type_lb_counter, 
    MPI_Cart_get_counter, 
    MPI_Add_error_class_counter, 
    MPI_Type_set_name_counter, 
    MPI_File_write_shared_counter, 
    MPI_Buffer_detach_counter, 
    MPI_File_set_size_counter, 
    MPI_Intercomm_create_counter, 
    MPI_File_iread_at_counter, 
    MPI_Allreduce_counter, 
    MPI_Comm_create_keyval_counter, 
    MPI_File_read_all_end_counter, 
    MPI_Comm_remote_size_counter, 
    MPI_Type_contiguous_counter, 
    MPI_Type_get_name_counter, 
    MPI_Reduce_counter, 
    MPI_Type_commit_counter, 
    MPI_Comm_get_parent_counter, 
    MPI_Type_hindexed_counter, 
    MPI_Type_extent_counter, 
    MPI_File_preallocate_counter, 
    MPI_File_get_position_counter, 
    MPI_Sendrecv_replace_counter, 
    MPI_Type_hvector_counter, 
    MPI_Buffer_attach_counter, 
    MPI_Group_translate_ranks_counter, 
    MPI_Testsome_counter, 
    MPI_Recv_init_counter, 
    MPI_Win_set_name_counter, 
    MPI_Type_dup_counter, 
    MPI_Comm_group_counter, 
    MPI_Add_error_code_counter, 
    MPI_Type_create_resized_counter, 
    MPI_File_seek_shared_counter, 
    MPI_Unpublish_name_counter, 
    MPI_Get_address_counter, 
    MPI_Is_thread_main_counter, 
    MPI_File_set_view_counter, 
    MPI_Comm_free_counter, 
    MPI_Type_create_indexed_block_counter, 
    MPI_Initialized_counter, 
    MPI_File_iwrite_counter, 
    MPI_Bsend_counter, 
    MPI_Group_excl_counter, 
    MPI_Get_count_counter, 
    MPI_Error_string_counter, 
    MPI_Grequest_start_counter, 
    MPI_Cartdim_get_counter, 
    MPI_Allgather_counter, 
    MPI_Cart_coords_counter, 
    MPI_Issend_counter, 
    MPI_File_sync_counter, 
    MPI_Rsend_counter, 
    MPI_File_get_amode_counter, 
    MPI_Abort_counter, 
    MPI_Grequest_complete_counter, 
    MPI_Pack_counter, 
    MPI_Win_set_attr_counter, 
    MPI_Info_create_counter, 
    MPI_File_open_counter, 
    MPI_Type_create_f90_complex_counter, 
    MPI_Gatherv_counter, 
    MPI_Type_get_attr_counter, 
    MPI_Comm_set_name_counter, 
    MPI_Comm_disconnect_counter, 
    MPI_Comm_remote_group_counter, 
    MPI_Cart_shift_counter, 
    MPI_Init_thread_counter, 
    MPI_Comm_size_counter, 
    MPI_Type_get_envelope_counter, 
    MPI_File_iread_shared_counter, 
    MPI_File_set_errhandler_counter, 
    MPI_Register_datarep_counter, 
    MPI_File_read_ordered_counter, 
    MPI_Init_counter, 
    MPI_Waitsome_counter, 
    MPI_Group_difference_counter, 
    MPI_Attr_get_counter, 
    MPI_Reduce_scatter_counter, 
    MPI_Type_create_f90_real_counter, 
    MPI_Wait_counter, 
    MPI_Testall_counter, 
    MPI_Group_incl_counter, 
    MPI_Irsend_counter, 
    MPI_Scatterv_counter, 
    MPI_File_call_errhandler_counter, 
    MPI_Comm_create_errhandler_counter, 
    MPI_Exscan_counter, 
    MPI_File_write_all_counter, 
    MPI_Comm_connect_counter, 
    MPI_Group_compare_counter, 
    MPI_Address_counter, 
    MPI_Comm_compare_counter, 
    MPI_Pack_external_counter, 
    MPI_Request_free_counter, 
    MPI_Topo_test_counter, 
    MPI_Irecv_counter, 
    MPI_Query_thread_counter, 
    MPI_Win_call_errhandler_counter, 
    MPI_Win_get_group_counter, 
    MPI_Keyval_create_counter, 
    MPI_Errhandler_create_counter, 
    MPI_Cart_create_counter, 
    MPI_Status_set_cancelled_counter, 
    MPI_Win_get_attr_counter, 
    MPI_Type_struct_counter, 
    MPI_Graph_neighbors_count_counter, 
    MPI_File_get_view_counter, 
    MPI_Allgatherv_counter, 
    MPI_Sendrecv_counter, 
    MPI_File_get_position_shared_counter, 
    MPI_Graph_neighbors_counter, 
    MPI_Group_rank_counter, 
    MPI_Dims_create_counter, 
    MPI_File_iread_counter, 
    MPI_Scatter_counter, 
    MPI_Comm_set_attr_counter, 
    MPI_Comm_free_keyval_counter, 
    MPI_Op_create_counter, 
    MPI_File_seek_counter, 
    MPI_Test_cancelled_counter, 
    MPI_Ssend_init_counter, 
    MPI_Rsend_init_counter, 
    MPI_Info_free_counter, 
    MPI_Publish_name_counter, 
    MPI_Bcast_counter, 
    MPI_Get_processor_name_counter, 
    MPI_Type_get_extent_counter, 
    MPI_File_write_ordered_end_counter, 
    MPI_Get_version_counter, 
    MPI_Graph_create_counter, 
    MPI_Put_counter, 
    MPI_File_write_at_all_counter, 
    MPI_Errhandler_get_counter, 
    MPI_Pack_size_counter, 
    MPI_Ibsend_counter, 
    MPI_Comm_test_inter_counter, 
    MPI_Intercomm_merge_counter, 
    MPI_Win_complete_counter, 
    MPI_File_get_type_extent_counter, 
    MPI_Graph_map_counter, 
    MPI_File_read_all_begin_counter, 
    MPI_Info_get_valuelen_counter, 
    MPI_Info_set_counter, 
    MPI_File_read_at_all_counter, 
    MPI_File_read_ordered_end_counter, 
    MPI_Isend_counter, 
    MPI_Type_set_attr_counter, 
    MPI_Group_union_counter, 
    MPI_Alltoall_counter, 
    MPI_Cart_sub_counter, 
    MPI_Info_get_counter, 
    MPI_Start_counter, 
    MPI_Comm_spawn_multiple_counter, 
    MPI_Group_intersection_counter, 
    MPI_Type_free_keyval_counter, 
    MPI_Pcontrol_counter, 
    MPI_Type_get_contents_counter, 
    MPI_Type_free_counter, 
    MPI_Info_get_nthkey_counter, 
    MPI_File_write_at_all_begin_counter, 
    MPI_Unpack_external_counter, 
    MPI_Errhandler_set_counter, 
    MPI_File_read_at_all_begin_counter, 
    MPI_File_iwrite_at_counter, 
    MPI_Win_lock_counter, 
    MPI_Win_unlock_counter, 
    MPI_Test_counter, 
    MPI_File_write_all_end_counter, 
    MPI_Info_get_nkeys_counter, 
    MPI_Win_start_counter, 
    MPI_File_get_size_counter, 
    MPI_Finalized_counter, 
    MPI_Win_free_keyval_counter, 
    MPI_Waitany_counter, 
    MPI_Open_port_counter, 
    MPI_Type_indexed_counter, 
    MPI_Send_init_counter, 
    MPI_Gather_counter, 
    MPI_Get_elements_counter, 
    MPI_File_write_counter, 
    MPI_File_read_at_all_end_counter, 
    MPI_Probe_counter, 
    MPI_Send_counter, 
    MPI_Unpack_counter, 
    MPI_Type_ub_counter, 
    MPI_Status_set_elements_counter, 
    MPI_Win_delete_attr_counter, 
    MPI_Testany_counter, 
    MPI_File_set_atomicity_counter, 
    MPI_Group_range_incl_counter, 
    MPI_Get_counter, 
    MPI_Type_vector_counter, 
    MPI_File_write_at_all_end_counter, 
    MPI_Type_get_true_extent_counter, 
    MPI_Graph_get_counter, 
    MPI_Info_delete_counter, 
    MPI_Comm_spawn_counter, 
    MPI_Cart_rank_counter, 
    MPI_Finalize_counter, 
    MPI_Comm_create_counter, 
    MPI_Pack_external_size_counter, 
    MPI_Comm_join_counter, 
    MPI_File_read_shared_counter, 
    MPI_Keyval_free_counter, 
    MPI_Win_wait_counter, 
    MPI_Alloc_mem_counter, 
    MPI_Type_size_counter, 
    MPI_Lookup_name_counter, 
    MPI_File_get_atomicity_counter, 
    MPI_Win_get_name_counter, 
    MPI_Type_create_darray_counter, 
    MPI_Type_create_hindexed_counter, 
    MPI_Win_create_errhandler_counter, 
    MPI_Cart_map_counter, 
    MPI_File_write_at_counter, 
    MPI_Comm_accept_counter, 
    MPI_Type_create_struct_counter, 
    MPI_Wtick_counter, 
    MPI_File_set_info_counter, 
    MPI_Close_port_counter, 
    MPI_File_get_byte_offset_counter, 
    MPI_Type_create_f90_integer_counter, 
    MPI_Type_create_subarray_counter, 
    MPI_File_delete_counter, 
    MPI_File_close_counter, 
    MPI_Win_create_counter, 
    MPI_File_read_all_counter, 
    MPI_Comm_call_errhandler_counter, 
    MPI_Recv_counter, 
    MPI_Comm_dup_counter, 
    MPI_Waitall_counter, 
    MPI_Comm_delete_attr_counter, 
    MPI_Ssend_counter, 
    MPI_Group_size_counter, 
    MPI_File_get_errhandler_counter, 
    MPI_Attr_put_counter, 
    MPI_Barrier_counter, 
    MPI_Win_free_counter, 
    MPI_Alltoallw_counter, 
    MPI_Alltoallv_counter, 
    MPI_Bsend_init_counter, 
    MPI_Add_error_string_counter, 
    MPI_Op_free_counter, 
    MPI_Win_set_errhandler_counter, 
    MPI_Accumulate_counter, 
    MPI_Comm_get_name_counter, 
    MPI_File_create_errhandler_counter, 
    MPI_File_write_ordered_counter, 
    MPI_Group_range_excl_counter, 
    MPI_Comm_split_counter, 
    MPI_Comm_set_errhandler_counter, 
    MPI_Request_get_status_counter, 
    MPI_Group_free_counter, 
    MPI_Type_create_keyval_counter, 
    MPI_File_write_ordered_begin_counter, 
    MPI_File_read_ordered_begin_counter, 
    MPI_Iprobe_counter, 
    MPI_Comm_rank_counter, 
    MPI_Comm_get_errhandler_counter, 
    MPI_Cancel_counter, 
    MPI_Win_fence_counter, 
    MPI_Win_create_keyval_counter, 
    MPI_Errhandler_free_counter, 
    MPI_Win_test_counter, 
    MPI_File_read_at_counter, 
    MPI_Type_match_size_counter, 
    MPI_Graphdims_get_counter, 
    MPI_Type_create_hvector_counter, 

};

Operation_counter counters {
    OPER_COUNTER(MPI_File_write_all_begin_counter, "MPI_File_write_all_begin"),
    OPER_COUNTER(MPI_Win_post_counter, "MPI_Win_post"),
    OPER_COUNTER(MPI_Win_get_errhandler_counter, "MPI_Win_get_errhandler"),
    OPER_COUNTER(MPI_File_read_counter, "MPI_File_read"),
    OPER_COUNTER(MPI_File_get_group_counter, "MPI_File_get_group"),
    OPER_COUNTER(MPI_Scan_counter, "MPI_Scan"),
    OPER_COUNTER(MPI_Startall_counter, "MPI_Startall"),
    OPER_COUNTER(MPI_Attr_delete_counter, "MPI_Attr_delete"),
    OPER_COUNTER(MPI_File_iwrite_shared_counter, "MPI_File_iwrite_shared"),
    OPER_COUNTER(MPI_Comm_get_attr_counter, "MPI_Comm_get_attr"),
    OPER_COUNTER(MPI_File_get_info_counter, "MPI_File_get_info"),
    OPER_COUNTER(MPI_Type_delete_attr_counter, "MPI_Type_delete_attr"),
    OPER_COUNTER(MPI_Error_class_counter, "MPI_Error_class"),
    OPER_COUNTER(MPI_Free_mem_counter, "MPI_Free_mem"),
    OPER_COUNTER(MPI_Wtime_counter, "MPI_Wtime"),
    OPER_COUNTER(MPI_Info_dup_counter, "MPI_Info_dup"),
    OPER_COUNTER(MPI_Type_lb_counter, "MPI_Type_lb"),
    OPER_COUNTER(MPI_Cart_get_counter, "MPI_Cart_get"),
    OPER_COUNTER(MPI_Add_error_class_counter, "MPI_Add_error_class"),
    OPER_COUNTER(MPI_Type_set_name_counter, "MPI_Type_set_name"),
    OPER_COUNTER(MPI_File_write_shared_counter, "MPI_File_write_shared"),
    OPER_COUNTER(MPI_Buffer_detach_counter, "MPI_Buffer_detach"),
    OPER_COUNTER(MPI_File_set_size_counter, "MPI_File_set_size"),
    OPER_COUNTER(MPI_Intercomm_create_counter, "MPI_Intercomm_create"),
    OPER_COUNTER(MPI_File_iread_at_counter, "MPI_File_iread_at"),
    OPER_COUNTER(MPI_Allreduce_counter, "MPI_Allreduce"),
    OPER_COUNTER(MPI_Comm_create_keyval_counter, "MPI_Comm_create_keyval"),
    OPER_COUNTER(MPI_File_read_all_end_counter, "MPI_File_read_all_end"),
    OPER_COUNTER(MPI_Comm_remote_size_counter, "MPI_Comm_remote_size"),
    OPER_COUNTER(MPI_Type_contiguous_counter, "MPI_Type_contiguous"),
    OPER_COUNTER(MPI_Type_get_name_counter, "MPI_Type_get_name"),
    OPER_COUNTER(MPI_Reduce_counter, "MPI_Reduce"),
    OPER_COUNTER(MPI_Type_commit_counter, "MPI_Type_commit"),
    OPER_COUNTER(MPI_Comm_get_parent_counter, "MPI_Comm_get_parent"),
    OPER_COUNTER(MPI_Type_hindexed_counter, "MPI_Type_hindexed"),
    OPER_COUNTER(MPI_Type_extent_counter, "MPI_Type_extent"),
    OPER_COUNTER(MPI_File_preallocate_counter, "MPI_File_preallocate"),
    OPER_COUNTER(MPI_File_get_position_counter, "MPI_File_get_position"),
    OPER_COUNTER(MPI_Sendrecv_replace_counter, "MPI_Sendrecv_replace"),
    OPER_COUNTER(MPI_Type_hvector_counter, "MPI_Type_hvector"),
    OPER_COUNTER(MPI_Buffer_attach_counter, "MPI_Buffer_attach"),
    OPER_COUNTER(MPI_Group_translate_ranks_counter, "MPI_Group_translate_ranks"),
    OPER_COUNTER(MPI_Testsome_counter, "MPI_Testsome"),
    OPER_COUNTER(MPI_Recv_init_counter, "MPI_Recv_init"),
    OPER_COUNTER(MPI_Win_set_name_counter, "MPI_Win_set_name"),
    OPER_COUNTER(MPI_Type_dup_counter, "MPI_Type_dup"),
    OPER_COUNTER(MPI_Comm_group_counter, "MPI_Comm_group"),
    OPER_COUNTER(MPI_Add_error_code_counter, "MPI_Add_error_code"),
    OPER_COUNTER(MPI_Type_create_resized_counter, "MPI_Type_create_resized"),
    OPER_COUNTER(MPI_File_seek_shared_counter, "MPI_File_seek_shared"),
    OPER_COUNTER(MPI_Unpublish_name_counter, "MPI_Unpublish_name"),
    OPER_COUNTER(MPI_Get_address_counter, "MPI_Get_address"),
    OPER_COUNTER(MPI_Is_thread_main_counter, "MPI_Is_thread_main"),
    OPER_COUNTER(MPI_File_set_view_counter, "MPI_File_set_view"),
    OPER_COUNTER(MPI_Comm_free_counter, "MPI_Comm_free"),
    OPER_COUNTER(MPI_Type_create_indexed_block_counter, "MPI_Type_create_indexed_block"),
    OPER_COUNTER(MPI_Initialized_counter, "MPI_Initialized"),
    OPER_COUNTER(MPI_File_iwrite_counter, "MPI_File_iwrite"),
    OPER_COUNTER(MPI_Bsend_counter, "MPI_Bsend"),
    OPER_COUNTER(MPI_Group_excl_counter, "MPI_Group_excl"),
    OPER_COUNTER(MPI_Get_count_counter, "MPI_Get_count"),
    OPER_COUNTER(MPI_Error_string_counter, "MPI_Error_string"),
    OPER_COUNTER(MPI_Grequest_start_counter, "MPI_Grequest_start"),
    OPER_COUNTER(MPI_Cartdim_get_counter, "MPI_Cartdim_get"),
    OPER_COUNTER(MPI_Allgather_counter, "MPI_Allgather"),
    OPER_COUNTER(MPI_Cart_coords_counter, "MPI_Cart_coords"),
    OPER_COUNTER(MPI_Issend_counter, "MPI_Issend"),
    OPER_COUNTER(MPI_File_sync_counter, "MPI_File_sync"),
    OPER_COUNTER(MPI_Rsend_counter, "MPI_Rsend"),
    OPER_COUNTER(MPI_File_get_amode_counter, "MPI_File_get_amode"),
    OPER_COUNTER(MPI_Abort_counter, "MPI_Abort"),
    OPER_COUNTER(MPI_Grequest_complete_counter, "MPI_Grequest_complete"),
    OPER_COUNTER(MPI_Pack_counter, "MPI_Pack"),
    OPER_COUNTER(MPI_Win_set_attr_counter, "MPI_Win_set_attr"),
    OPER_COUNTER(MPI_Info_create_counter, "MPI_Info_create"),
    OPER_COUNTER(MPI_File_open_counter, "MPI_File_open"),
    OPER_COUNTER(MPI_Type_create_f90_complex_counter, "MPI_Type_create_f90_complex"),
    OPER_COUNTER(MPI_Gatherv_counter, "MPI_Gatherv"),
    OPER_COUNTER(MPI_Type_get_attr_counter, "MPI_Type_get_attr"),
    OPER_COUNTER(MPI_Comm_set_name_counter, "MPI_Comm_set_name"),
    OPER_COUNTER(MPI_Comm_disconnect_counter, "MPI_Comm_disconnect"),
    OPER_COUNTER(MPI_Comm_remote_group_counter, "MPI_Comm_remote_group"),
    OPER_COUNTER(MPI_Cart_shift_counter, "MPI_Cart_shift"),
    OPER_COUNTER(MPI_Init_thread_counter, "MPI_Init_thread"),
    OPER_COUNTER(MPI_Comm_size_counter, "MPI_Comm_size"),
    OPER_COUNTER(MPI_Type_get_envelope_counter, "MPI_Type_get_envelope"),
    OPER_COUNTER(MPI_File_iread_shared_counter, "MPI_File_iread_shared"),
    OPER_COUNTER(MPI_File_set_errhandler_counter, "MPI_File_set_errhandler"),
    OPER_COUNTER(MPI_Register_datarep_counter, "MPI_Register_datarep"),
    OPER_COUNTER(MPI_File_read_ordered_counter, "MPI_File_read_ordered"),
    OPER_COUNTER(MPI_Init_counter, "MPI_Init"),
    OPER_COUNTER(MPI_Waitsome_counter, "MPI_Waitsome"),
    OPER_COUNTER(MPI_Group_difference_counter, "MPI_Group_difference"),
    OPER_COUNTER(MPI_Attr_get_counter, "MPI_Attr_get"),
    OPER_COUNTER(MPI_Reduce_scatter_counter, "MPI_Reduce_scatter"),
    OPER_COUNTER(MPI_Type_create_f90_real_counter, "MPI_Type_create_f90_real"),
    OPER_COUNTER(MPI_Wait_counter, "MPI_Wait"),
    OPER_COUNTER(MPI_Testall_counter, "MPI_Testall"),
    OPER_COUNTER(MPI_Group_incl_counter, "MPI_Group_incl"),
    OPER_COUNTER(MPI_Irsend_counter, "MPI_Irsend"),
    OPER_COUNTER(MPI_Scatterv_counter, "MPI_Scatterv"),
    OPER_COUNTER(MPI_File_call_errhandler_counter, "MPI_File_call_errhandler"),
    OPER_COUNTER(MPI_Comm_create_errhandler_counter, "MPI_Comm_create_errhandler"),
    OPER_COUNTER(MPI_Exscan_counter, "MPI_Exscan"),
    OPER_COUNTER(MPI_File_write_all_counter, "MPI_File_write_all"),
    OPER_COUNTER(MPI_Comm_connect_counter, "MPI_Comm_connect"),
    OPER_COUNTER(MPI_Group_compare_counter, "MPI_Group_compare"),
    OPER_COUNTER(MPI_Address_counter, "MPI_Address"),
    OPER_COUNTER(MPI_Comm_compare_counter, "MPI_Comm_compare"),
    OPER_COUNTER(MPI_Pack_external_counter, "MPI_Pack_external"),
    OPER_COUNTER(MPI_Request_free_counter, "MPI_Request_free"),
    OPER_COUNTER(MPI_Topo_test_counter, "MPI_Topo_test"),
    OPER_COUNTER(MPI_Irecv_counter, "MPI_Irecv"),
    OPER_COUNTER(MPI_Query_thread_counter, "MPI_Query_thread"),
    OPER_COUNTER(MPI_Win_call_errhandler_counter, "MPI_Win_call_errhandler"),
    OPER_COUNTER(MPI_Win_get_group_counter, "MPI_Win_get_group"),
    OPER_COUNTER(MPI_Keyval_create_counter, "MPI_Keyval_create"),
    OPER_COUNTER(MPI_Errhandler_create_counter, "MPI_Errhandler_create"),
    OPER_COUNTER(MPI_Cart_create_counter, "MPI_Cart_create"),
    OPER_COUNTER(MPI_Status_set_cancelled_counter, "MPI_Status_set_cancelled"),
    OPER_COUNTER(MPI_Win_get_attr_counter, "MPI_Win_get_attr"),
    OPER_COUNTER(MPI_Type_struct_counter, "MPI_Type_struct"),
    OPER_COUNTER(MPI_Graph_neighbors_count_counter, "MPI_Graph_neighbors_count"),
    OPER_COUNTER(MPI_File_get_view_counter, "MPI_File_get_view"),
    OPER_COUNTER(MPI_Allgatherv_counter, "MPI_Allgatherv"),
    OPER_COUNTER(MPI_Sendrecv_counter, "MPI_Sendrecv"),
    OPER_COUNTER(MPI_File_get_position_shared_counter, "MPI_File_get_position_shared"),
    OPER_COUNTER(MPI_Graph_neighbors_counter, "MPI_Graph_neighbors"),
    OPER_COUNTER(MPI_Group_rank_counter, "MPI_Group_rank"),
    OPER_COUNTER(MPI_Dims_create_counter, "MPI_Dims_create"),
    OPER_COUNTER(MPI_File_iread_counter, "MPI_File_iread"),
    OPER_COUNTER(MPI_Scatter_counter, "MPI_Scatter"),
    OPER_COUNTER(MPI_Comm_set_attr_counter, "MPI_Comm_set_attr"),
    OPER_COUNTER(MPI_Comm_free_keyval_counter, "MPI_Comm_free_keyval"),
    OPER_COUNTER(MPI_Op_create_counter, "MPI_Op_create"),
    OPER_COUNTER(MPI_File_seek_counter, "MPI_File_seek"),
    OPER_COUNTER(MPI_Test_cancelled_counter, "MPI_Test_cancelled"),
    OPER_COUNTER(MPI_Ssend_init_counter, "MPI_Ssend_init"),
    OPER_COUNTER(MPI_Rsend_init_counter, "MPI_Rsend_init"),
    OPER_COUNTER(MPI_Info_free_counter, "MPI_Info_free"),
    OPER_COUNTER(MPI_Publish_name_counter, "MPI_Publish_name"),
    OPER_COUNTER(MPI_Bcast_counter, "MPI_Bcast"),
    OPER_COUNTER(MPI_Get_processor_name_counter, "MPI_Get_processor_name"),
    OPER_COUNTER(MPI_Type_get_extent_counter, "MPI_Type_get_extent"),
    OPER_COUNTER(MPI_File_write_ordered_end_counter, "MPI_File_write_ordered_end"),
    OPER_COUNTER(MPI_Get_version_counter, "MPI_Get_version"),
    OPER_COUNTER(MPI_Graph_create_counter, "MPI_Graph_create"),
    OPER_COUNTER(MPI_Put_counter, "MPI_Put"),
    OPER_COUNTER(MPI_File_write_at_all_counter, "MPI_File_write_at_all"),
    OPER_COUNTER(MPI_Errhandler_get_counter, "MPI_Errhandler_get"),
    OPER_COUNTER(MPI_Pack_size_counter, "MPI_Pack_size"),
    OPER_COUNTER(MPI_Ibsend_counter, "MPI_Ibsend"),
    OPER_COUNTER(MPI_Comm_test_inter_counter, "MPI_Comm_test_inter"),
    OPER_COUNTER(MPI_Intercomm_merge_counter, "MPI_Intercomm_merge"),
    OPER_COUNTER(MPI_Win_complete_counter, "MPI_Win_complete"),
    OPER_COUNTER(MPI_File_get_type_extent_counter, "MPI_File_get_type_extent"),
    OPER_COUNTER(MPI_Graph_map_counter, "MPI_Graph_map"),
    OPER_COUNTER(MPI_File_read_all_begin_counter, "MPI_File_read_all_begin"),
    OPER_COUNTER(MPI_Info_get_valuelen_counter, "MPI_Info_get_valuelen"),
    OPER_COUNTER(MPI_Info_set_counter, "MPI_Info_set"),
    OPER_COUNTER(MPI_File_read_at_all_counter, "MPI_File_read_at_all"),
    OPER_COUNTER(MPI_File_read_ordered_end_counter, "MPI_File_read_ordered_end"),
    OPER_COUNTER(MPI_Isend_counter, "MPI_Isend"),
    OPER_COUNTER(MPI_Type_set_attr_counter, "MPI_Type_set_attr"),
    OPER_COUNTER(MPI_Group_union_counter, "MPI_Group_union"),
    OPER_COUNTER(MPI_Alltoall_counter, "MPI_Alltoall"),
    OPER_COUNTER(MPI_Cart_sub_counter, "MPI_Cart_sub"),
    OPER_COUNTER(MPI_Info_get_counter, "MPI_Info_get"),
    OPER_COUNTER(MPI_Start_counter, "MPI_Start"),
    OPER_COUNTER(MPI_Comm_spawn_multiple_counter, "MPI_Comm_spawn_multiple"),
    OPER_COUNTER(MPI_Group_intersection_counter, "MPI_Group_intersection"),
    OPER_COUNTER(MPI_Type_free_keyval_counter, "MPI_Type_free_keyval"),
    OPER_COUNTER(MPI_Pcontrol_counter, "MPI_Pcontrol"),
    OPER_COUNTER(MPI_Type_get_contents_counter, "MPI_Type_get_contents"),
    OPER_COUNTER(MPI_Type_free_counter, "MPI_Type_free"),
    OPER_COUNTER(MPI_Info_get_nthkey_counter, "MPI_Info_get_nthkey"),
    OPER_COUNTER(MPI_File_write_at_all_begin_counter, "MPI_File_write_at_all_begin"),
    OPER_COUNTER(MPI_Unpack_external_counter, "MPI_Unpack_external"),
    OPER_COUNTER(MPI_Errhandler_set_counter, "MPI_Errhandler_set"),
    OPER_COUNTER(MPI_File_read_at_all_begin_counter, "MPI_File_read_at_all_begin"),
    OPER_COUNTER(MPI_File_iwrite_at_counter, "MPI_File_iwrite_at"),
    OPER_COUNTER(MPI_Win_lock_counter, "MPI_Win_lock"),
    OPER_COUNTER(MPI_Win_unlock_counter, "MPI_Win_unlock"),
    OPER_COUNTER(MPI_Test_counter, "MPI_Test"),
    OPER_COUNTER(MPI_File_write_all_end_counter, "MPI_File_write_all_end"),
    OPER_COUNTER(MPI_Info_get_nkeys_counter, "MPI_Info_get_nkeys"),
    OPER_COUNTER(MPI_Win_start_counter, "MPI_Win_start"),
    OPER_COUNTER(MPI_File_get_size_counter, "MPI_File_get_size"),
    OPER_COUNTER(MPI_Finalized_counter, "MPI_Finalized"),
    OPER_COUNTER(MPI_Win_free_keyval_counter, "MPI_Win_free_keyval"),
    OPER_COUNTER(MPI_Waitany_counter, "MPI_Waitany"),
    OPER_COUNTER(MPI_Open_port_counter, "MPI_Open_port"),
    OPER_COUNTER(MPI_Type_indexed_counter, "MPI_Type_indexed"),
    OPER_COUNTER(MPI_Send_init_counter, "MPI_Send_init"),
    OPER_COUNTER(MPI_Gather_counter, "MPI_Gather"),
    OPER_COUNTER(MPI_Get_elements_counter, "MPI_Get_elements"),
    OPER_COUNTER(MPI_File_write_counter, "MPI_File_write"),
    OPER_COUNTER(MPI_File_read_at_all_end_counter, "MPI_File_read_at_all_end"),
    OPER_COUNTER(MPI_Probe_counter, "MPI_Probe"),
    OPER_COUNTER(MPI_Send_counter, "MPI_Send"),
    OPER_COUNTER(MPI_Unpack_counter, "MPI_Unpack"),
    OPER_COUNTER(MPI_Type_ub_counter, "MPI_Type_ub"),
    OPER_COUNTER(MPI_Status_set_elements_counter, "MPI_Status_set_elements"),
    OPER_COUNTER(MPI_Win_delete_attr_counter, "MPI_Win_delete_attr"),
    OPER_COUNTER(MPI_Testany_counter, "MPI_Testany"),
    OPER_COUNTER(MPI_File_set_atomicity_counter, "MPI_File_set_atomicity"),
    OPER_COUNTER(MPI_Group_range_incl_counter, "MPI_Group_range_incl"),
    OPER_COUNTER(MPI_Get_counter, "MPI_Get"),
    OPER_COUNTER(MPI_Type_vector_counter, "MPI_Type_vector"),
    OPER_COUNTER(MPI_File_write_at_all_end_counter, "MPI_File_write_at_all_end"),
    OPER_COUNTER(MPI_Type_get_true_extent_counter, "MPI_Type_get_true_extent"),
    OPER_COUNTER(MPI_Graph_get_counter, "MPI_Graph_get"),
    OPER_COUNTER(MPI_Info_delete_counter, "MPI_Info_delete"),
    OPER_COUNTER(MPI_Comm_spawn_counter, "MPI_Comm_spawn"),
    OPER_COUNTER(MPI_Cart_rank_counter, "MPI_Cart_rank"),
    OPER_COUNTER(MPI_Finalize_counter, "MPI_Finalize"),
    OPER_COUNTER(MPI_Comm_create_counter, "MPI_Comm_create"),
    OPER_COUNTER(MPI_Pack_external_size_counter, "MPI_Pack_external_size"),
    OPER_COUNTER(MPI_Comm_join_counter, "MPI_Comm_join"),
    OPER_COUNTER(MPI_File_read_shared_counter, "MPI_File_read_shared"),
    OPER_COUNTER(MPI_Keyval_free_counter, "MPI_Keyval_free"),
    OPER_COUNTER(MPI_Win_wait_counter, "MPI_Win_wait"),
    OPER_COUNTER(MPI_Alloc_mem_counter, "MPI_Alloc_mem"),
    OPER_COUNTER(MPI_Type_size_counter, "MPI_Type_size"),
    OPER_COUNTER(MPI_Lookup_name_counter, "MPI_Lookup_name"),
    OPER_COUNTER(MPI_File_get_atomicity_counter, "MPI_File_get_atomicity"),
    OPER_COUNTER(MPI_Win_get_name_counter, "MPI_Win_get_name"),
    OPER_COUNTER(MPI_Type_create_darray_counter, "MPI_Type_create_darray"),
    OPER_COUNTER(MPI_Type_create_hindexed_counter, "MPI_Type_create_hindexed"),
    OPER_COUNTER(MPI_Win_create_errhandler_counter, "MPI_Win_create_errhandler"),
    OPER_COUNTER(MPI_Cart_map_counter, "MPI_Cart_map"),
    OPER_COUNTER(MPI_File_write_at_counter, "MPI_File_write_at"),
    OPER_COUNTER(MPI_Comm_accept_counter, "MPI_Comm_accept"),
    OPER_COUNTER(MPI_Type_create_struct_counter, "MPI_Type_create_struct"),
    OPER_COUNTER(MPI_Wtick_counter, "MPI_Wtick"),
    OPER_COUNTER(MPI_File_set_info_counter, "MPI_File_set_info"),
    OPER_COUNTER(MPI_Close_port_counter, "MPI_Close_port"),
    OPER_COUNTER(MPI_File_get_byte_offset_counter, "MPI_File_get_byte_offset"),
    OPER_COUNTER(MPI_Type_create_f90_integer_counter, "MPI_Type_create_f90_integer"),
    OPER_COUNTER(MPI_Type_create_subarray_counter, "MPI_Type_create_subarray"),
    OPER_COUNTER(MPI_File_delete_counter, "MPI_File_delete"),
    OPER_COUNTER(MPI_File_close_counter, "MPI_File_close"),
    OPER_COUNTER(MPI_Win_create_counter, "MPI_Win_create"),
    OPER_COUNTER(MPI_File_read_all_counter, "MPI_File_read_all"),
    OPER_COUNTER(MPI_Comm_call_errhandler_counter, "MPI_Comm_call_errhandler"),
    OPER_COUNTER(MPI_Recv_counter, "MPI_Recv"),
    OPER_COUNTER(MPI_Comm_dup_counter, "MPI_Comm_dup"),
    OPER_COUNTER(MPI_Waitall_counter, "MPI_Waitall"),
    OPER_COUNTER(MPI_Comm_delete_attr_counter, "MPI_Comm_delete_attr"),
    OPER_COUNTER(MPI_Ssend_counter, "MPI_Ssend"),
    OPER_COUNTER(MPI_Group_size_counter, "MPI_Group_size"),
    OPER_COUNTER(MPI_File_get_errhandler_counter, "MPI_File_get_errhandler"),
    OPER_COUNTER(MPI_Attr_put_counter, "MPI_Attr_put"),
    OPER_COUNTER(MPI_Barrier_counter, "MPI_Barrier"),
    OPER_COUNTER(MPI_Win_free_counter, "MPI_Win_free"),
    OPER_COUNTER(MPI_Alltoallw_counter, "MPI_Alltoallw"),
    OPER_COUNTER(MPI_Alltoallv_counter, "MPI_Alltoallv"),
    OPER_COUNTER(MPI_Bsend_init_counter, "MPI_Bsend_init"),
    OPER_COUNTER(MPI_Add_error_string_counter, "MPI_Add_error_string"),
    OPER_COUNTER(MPI_Op_free_counter, "MPI_Op_free"),
    OPER_COUNTER(MPI_Win_set_errhandler_counter, "MPI_Win_set_errhandler"),
    OPER_COUNTER(MPI_Accumulate_counter, "MPI_Accumulate"),
    OPER_COUNTER(MPI_Comm_get_name_counter, "MPI_Comm_get_name"),
    OPER_COUNTER(MPI_File_create_errhandler_counter, "MPI_File_create_errhandler"),
    OPER_COUNTER(MPI_File_write_ordered_counter, "MPI_File_write_ordered"),
    OPER_COUNTER(MPI_Group_range_excl_counter, "MPI_Group_range_excl"),
    OPER_COUNTER(MPI_Comm_split_counter, "MPI_Comm_split"),
    OPER_COUNTER(MPI_Comm_set_errhandler_counter, "MPI_Comm_set_errhandler"),
    OPER_COUNTER(MPI_Request_get_status_counter, "MPI_Request_get_status"),
    OPER_COUNTER(MPI_Group_free_counter, "MPI_Group_free"),
    OPER_COUNTER(MPI_Type_create_keyval_counter, "MPI_Type_create_keyval"),
    OPER_COUNTER(MPI_File_write_ordered_begin_counter, "MPI_File_write_ordered_begin"),
    OPER_COUNTER(MPI_File_read_ordered_begin_counter, "MPI_File_read_ordered_begin"),
    OPER_COUNTER(MPI_Iprobe_counter, "MPI_Iprobe"),
    OPER_COUNTER(MPI_Comm_rank_counter, "MPI_Comm_rank"),
    OPER_COUNTER(MPI_Comm_get_errhandler_counter, "MPI_Comm_get_errhandler"),
    OPER_COUNTER(MPI_Cancel_counter, "MPI_Cancel"),
    OPER_COUNTER(MPI_Win_fence_counter, "MPI_Win_fence"),
    OPER_COUNTER(MPI_Win_create_keyval_counter, "MPI_Win_create_keyval"),
    OPER_COUNTER(MPI_Errhandler_free_counter, "MPI_Errhandler_free"),
    OPER_COUNTER(MPI_Win_test_counter, "MPI_Win_test"),
    OPER_COUNTER(MPI_File_read_at_counter, "MPI_File_read_at"),
    OPER_COUNTER(MPI_Type_match_size_counter, "MPI_Type_match_size"),
    OPER_COUNTER(MPI_Graphdims_get_counter, "MPI_Graphdims_get"),
    OPER_COUNTER(MPI_Type_create_hvector_counter, "MPI_Type_create_hvector"),

};

/* ================== C Wrappers for MPI_File_write_all_begin ================== */
_EXTERN_C_ int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype);
_EXTERN_C_ int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_all_begin(fh, buf, count, datatype);
    Post_MPI(MPI_File_write_all_begin_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_post ================== */
_EXTERN_C_ int PMPI_Win_post(MPI_Group group, int assert, MPI_Win win);
_EXTERN_C_ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_post(group, assert, win);
    Post_MPI(MPI_Win_post_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_get_errhandler ================== */
_EXTERN_C_ int PMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_get_errhandler(win, errhandler);
    Post_MPI(MPI_Win_get_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read ================== */
_EXTERN_C_ int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_read_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_group ================== */
_EXTERN_C_ int PMPI_File_get_group(MPI_File fh, MPI_Group *group);
_EXTERN_C_ int MPI_File_get_group(MPI_File fh, MPI_Group *group) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_group(fh, group);
    Post_MPI(MPI_File_get_group_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Scan ================== */
_EXTERN_C_ int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
_EXTERN_C_ int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Scan(sendbuf, recvbuf, count, datatype, op, comm);
    Post_MPI(MPI_Scan_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Startall ================== */
_EXTERN_C_ int PMPI_Startall(int count, MPI_Request *array_of_requests);
_EXTERN_C_ int MPI_Startall(int count, MPI_Request *array_of_requests) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Startall(count, array_of_requests);
    Post_MPI(MPI_Startall_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Attr_delete ================== */
_EXTERN_C_ int PMPI_Attr_delete(MPI_Comm comm, int keyval);
_EXTERN_C_ int MPI_Attr_delete(MPI_Comm comm, int keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Attr_delete(comm, keyval);
    Post_MPI(MPI_Attr_delete_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_iwrite_shared ================== */
_EXTERN_C_ int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
_EXTERN_C_ int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_iwrite_shared(fh, buf, count, datatype, request);
    Post_MPI(MPI_File_iwrite_shared_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_get_attr ================== */
_EXTERN_C_ int PMPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag);
_EXTERN_C_ int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_get_attr(comm, comm_keyval, attribute_val, flag);
    Post_MPI(MPI_Comm_get_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_info ================== */
_EXTERN_C_ int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used);
_EXTERN_C_ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_info(fh, info_used);
    Post_MPI(MPI_File_get_info_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_delete_attr ================== */
_EXTERN_C_ int PMPI_Type_delete_attr(MPI_Datatype type, int type_keyval);
_EXTERN_C_ int MPI_Type_delete_attr(MPI_Datatype type, int type_keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_delete_attr(type, type_keyval);
    Post_MPI(MPI_Type_delete_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Error_class ================== */
_EXTERN_C_ int PMPI_Error_class(int errorcode, int *errorclass);
_EXTERN_C_ int MPI_Error_class(int errorcode, int *errorclass) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Error_class(errorcode, errorclass);
    Post_MPI(MPI_Error_class_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Free_mem ================== */
_EXTERN_C_ int PMPI_Free_mem(void *base);
_EXTERN_C_ int MPI_Free_mem(void *base) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Free_mem(base);
    Post_MPI(MPI_Free_mem_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Wtime ================== */
_EXTERN_C_ double PMPI_Wtime();
_EXTERN_C_ double MPI_Wtime() { 
    double _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Wtime();
    Post_MPI(MPI_Wtime_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_dup ================== */
_EXTERN_C_ int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
_EXTERN_C_ int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_dup(info, newinfo);
    Post_MPI(MPI_Info_dup_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_lb ================== */
_EXTERN_C_ int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb);
_EXTERN_C_ int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_lb(type, lb);
    Post_MPI(MPI_Type_lb_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_get ================== */
_EXTERN_C_ int PMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords);
_EXTERN_C_ int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_get(comm, maxdims, dims, periods, coords);
    Post_MPI(MPI_Cart_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Add_error_class ================== */
_EXTERN_C_ int PMPI_Add_error_class(int *errorclass);
_EXTERN_C_ int MPI_Add_error_class(int *errorclass) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Add_error_class(errorclass);
    Post_MPI(MPI_Add_error_class_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_set_name ================== */
_EXTERN_C_ int PMPI_Type_set_name(MPI_Datatype type, char *type_name);
_EXTERN_C_ int MPI_Type_set_name(MPI_Datatype type, char *type_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_set_name(type, type_name);
    Post_MPI(MPI_Type_set_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_shared ================== */
_EXTERN_C_ int PMPI_File_write_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_shared(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_write_shared_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Buffer_detach ================== */
_EXTERN_C_ int PMPI_Buffer_detach(void *buffer, int *size);
_EXTERN_C_ int MPI_Buffer_detach(void *buffer, int *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Buffer_detach(buffer, size);
    Post_MPI(MPI_Buffer_detach_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_set_size ================== */
_EXTERN_C_ int PMPI_File_set_size(MPI_File fh, MPI_Offset size);
_EXTERN_C_ int MPI_File_set_size(MPI_File fh, MPI_Offset size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_set_size(fh, size);
    Post_MPI(MPI_File_set_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Intercomm_create ================== */
_EXTERN_C_ int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm bridge_comm, int remote_leader, int tag, MPI_Comm *newintercomm);
_EXTERN_C_ int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm bridge_comm, int remote_leader, int tag, MPI_Comm *newintercomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Intercomm_create(local_comm, local_leader, bridge_comm, remote_leader, tag, newintercomm);
    Post_MPI(MPI_Intercomm_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_iread_at ================== */
_EXTERN_C_ int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
_EXTERN_C_ int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_iread_at(fh, offset, buf, count, datatype, request);
    Post_MPI(MPI_File_iread_at_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Allreduce ================== */
_EXTERN_C_ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
_EXTERN_C_ int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
    Post_MPI(MPI_Allreduce_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_create_keyval ================== */
_EXTERN_C_ int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, MPI_Comm_delete_attr_function *comm_delete_attr_fn, int *comm_keyval, void *extra_state);
_EXTERN_C_ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, MPI_Comm_delete_attr_function *comm_delete_attr_fn, int *comm_keyval, void *extra_state) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_create_keyval(comm_copy_attr_fn, comm_delete_attr_fn, comm_keyval, extra_state);
    Post_MPI(MPI_Comm_create_keyval_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_all_end ================== */
_EXTERN_C_ int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_all_end(fh, buf, status);
    Post_MPI(MPI_File_read_all_end_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_remote_size ================== */
_EXTERN_C_ int PMPI_Comm_remote_size(MPI_Comm comm, int *size);
_EXTERN_C_ int MPI_Comm_remote_size(MPI_Comm comm, int *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_remote_size(comm, size);
    Post_MPI(MPI_Comm_remote_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_contiguous ================== */
_EXTERN_C_ int PMPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_contiguous(count, oldtype, newtype);
    Post_MPI(MPI_Type_contiguous_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_get_name ================== */
_EXTERN_C_ int PMPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen);
_EXTERN_C_ int MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_get_name(type, type_name, resultlen);
    Post_MPI(MPI_Type_get_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Reduce ================== */
_EXTERN_C_ int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
_EXTERN_C_ int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
    Post_MPI(MPI_Reduce_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_commit ================== */
_EXTERN_C_ int PMPI_Type_commit(MPI_Datatype *type);
_EXTERN_C_ int MPI_Type_commit(MPI_Datatype *type) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_commit(type);
    Post_MPI(MPI_Type_commit_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_get_parent ================== */
_EXTERN_C_ int PMPI_Comm_get_parent(MPI_Comm *parent);
_EXTERN_C_ int MPI_Comm_get_parent(MPI_Comm *parent) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_get_parent(parent);
    Post_MPI(MPI_Comm_get_parent_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_hindexed ================== */
_EXTERN_C_ int PMPI_Type_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_hindexed(count, array_of_blocklengths, array_of_displacements, oldtype, newtype);
    Post_MPI(MPI_Type_hindexed_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_extent ================== */
_EXTERN_C_ int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent);
_EXTERN_C_ int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_extent(type, extent);
    Post_MPI(MPI_Type_extent_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_preallocate ================== */
_EXTERN_C_ int PMPI_File_preallocate(MPI_File fh, MPI_Offset size);
_EXTERN_C_ int MPI_File_preallocate(MPI_File fh, MPI_Offset size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_preallocate(fh, size);
    Post_MPI(MPI_File_preallocate_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_position ================== */
_EXTERN_C_ int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset);
_EXTERN_C_ int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_position(fh, offset);
    Post_MPI(MPI_File_get_position_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Sendrecv_replace ================== */
_EXTERN_C_ int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status);
_EXTERN_C_ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Sendrecv_replace(buf, count, datatype, dest, sendtag, source, recvtag, comm, status);
    Post_MPI(MPI_Sendrecv_replace_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_hvector ================== */
_EXTERN_C_ int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_hvector(count, blocklength, stride, oldtype, newtype);
    Post_MPI(MPI_Type_hvector_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Buffer_attach ================== */
_EXTERN_C_ int PMPI_Buffer_attach(void *buffer, int size);
_EXTERN_C_ int MPI_Buffer_attach(void *buffer, int size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Buffer_attach(buffer, size);
    Post_MPI(MPI_Buffer_attach_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_translate_ranks ================== */
_EXTERN_C_ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2);
_EXTERN_C_ int MPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_translate_ranks(group1, n, ranks1, group2, ranks2);
    Post_MPI(MPI_Group_translate_ranks_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Testsome ================== */
_EXTERN_C_ int PMPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[]);
_EXTERN_C_ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount, int array_of_indices[], MPI_Status array_of_statuses[]) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Testsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses);
    Post_MPI(MPI_Testsome_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Recv_init ================== */
_EXTERN_C_ int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Recv_init(buf, count, datatype, source, tag, comm, request);
    Post_MPI(MPI_Recv_init_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_set_name ================== */
_EXTERN_C_ int PMPI_Win_set_name(MPI_Win win, char *win_name);
_EXTERN_C_ int MPI_Win_set_name(MPI_Win win, char *win_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_set_name(win, win_name);
    Post_MPI(MPI_Win_set_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_dup ================== */
_EXTERN_C_ int PMPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_dup(MPI_Datatype type, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_dup(type, newtype);
    Post_MPI(MPI_Type_dup_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_group ================== */
_EXTERN_C_ int PMPI_Comm_group(MPI_Comm comm, MPI_Group *group);
_EXTERN_C_ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_group(comm, group);
    Post_MPI(MPI_Comm_group_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Add_error_code ================== */
_EXTERN_C_ int PMPI_Add_error_code(int errorclass, int *errorcode);
_EXTERN_C_ int MPI_Add_error_code(int errorclass, int *errorcode) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Add_error_code(errorclass, errorcode);
    Post_MPI(MPI_Add_error_code_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_resized ================== */
_EXTERN_C_ int PMPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_resized(oldtype, lb, extent, newtype);
    Post_MPI(MPI_Type_create_resized_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_seek_shared ================== */
_EXTERN_C_ int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence);
_EXTERN_C_ int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_seek_shared(fh, offset, whence);
    Post_MPI(MPI_File_seek_shared_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Unpublish_name ================== */
_EXTERN_C_ int PMPI_Unpublish_name(char *service_name, MPI_Info info, char *port_name);
_EXTERN_C_ int MPI_Unpublish_name(char *service_name, MPI_Info info, char *port_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Unpublish_name(service_name, info, port_name);
    Post_MPI(MPI_Unpublish_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Get_address ================== */
_EXTERN_C_ int PMPI_Get_address(void *location, MPI_Aint *address);
_EXTERN_C_ int MPI_Get_address(void *location, MPI_Aint *address) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Get_address(location, address);
    Post_MPI(MPI_Get_address_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Is_thread_main ================== */
_EXTERN_C_ int PMPI_Is_thread_main(int *flag);
_EXTERN_C_ int MPI_Is_thread_main(int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Is_thread_main(flag);
    Post_MPI(MPI_Is_thread_main_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_set_view ================== */
_EXTERN_C_ int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info);
_EXTERN_C_ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_set_view(fh, disp, etype, filetype, datarep, info);
    Post_MPI(MPI_File_set_view_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_free ================== */
_EXTERN_C_ int PMPI_Comm_free(MPI_Comm *comm);
_EXTERN_C_ int MPI_Comm_free(MPI_Comm *comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_free(comm);
    Post_MPI(MPI_Comm_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_indexed_block ================== */
_EXTERN_C_ int PMPI_Type_create_indexed_block(int count, int blocklength, int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_indexed_block(int count, int blocklength, int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_indexed_block(count, blocklength, array_of_displacements, oldtype, newtype);
    Post_MPI(MPI_Type_create_indexed_block_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Initialized ================== */
_EXTERN_C_ int PMPI_Initialized(int *flag);
_EXTERN_C_ int MPI_Initialized(int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Initialized(flag);
    Post_MPI(MPI_Initialized_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_iwrite ================== */
_EXTERN_C_ int PMPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
_EXTERN_C_ int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_iwrite(fh, buf, count, datatype, request);
    Post_MPI(MPI_File_iwrite_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Bsend ================== */
_EXTERN_C_ int PMPI_Bsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
_EXTERN_C_ int MPI_Bsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Bsend(buf, count, datatype, dest, tag, comm);
    Post_MPI(MPI_Bsend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_excl ================== */
_EXTERN_C_ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_excl(group, n, ranks, newgroup);
    Post_MPI(MPI_Group_excl_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Get_count ================== */
_EXTERN_C_ int PMPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count);
_EXTERN_C_ int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Get_count(status, datatype, count);
    Post_MPI(MPI_Get_count_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Error_string ================== */
_EXTERN_C_ int PMPI_Error_string(int errorcode, char *string, int *resultlen);
_EXTERN_C_ int MPI_Error_string(int errorcode, char *string, int *resultlen) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Error_string(errorcode, string, resultlen);
    Post_MPI(MPI_Error_string_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Grequest_start ================== */
_EXTERN_C_ int PMPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request);
_EXTERN_C_ int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Grequest_start(query_fn, free_fn, cancel_fn, extra_state, request);
    Post_MPI(MPI_Grequest_start_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cartdim_get ================== */
_EXTERN_C_ int PMPI_Cartdim_get(MPI_Comm comm, int *ndims);
_EXTERN_C_ int MPI_Cartdim_get(MPI_Comm comm, int *ndims) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cartdim_get(comm, ndims);
    Post_MPI(MPI_Cartdim_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Allgather ================== */
_EXTERN_C_ int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
_EXTERN_C_ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
    Post_MPI(MPI_Allgather_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_coords ================== */
_EXTERN_C_ int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords);
_EXTERN_C_ int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_coords(comm, rank, maxdims, coords);
    Post_MPI(MPI_Cart_coords_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Issend ================== */
_EXTERN_C_ int PMPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Issend(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Issend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_sync ================== */
_EXTERN_C_ int PMPI_File_sync(MPI_File fh);
_EXTERN_C_ int MPI_File_sync(MPI_File fh) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_sync(fh);
    Post_MPI(MPI_File_sync_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Rsend ================== */
_EXTERN_C_ int PMPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
_EXTERN_C_ int MPI_Rsend(void *ibuf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Rsend(ibuf, count, datatype, dest, tag, comm);
    Post_MPI(MPI_Rsend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_amode ================== */
_EXTERN_C_ int PMPI_File_get_amode(MPI_File fh, int *amode);
_EXTERN_C_ int MPI_File_get_amode(MPI_File fh, int *amode) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_amode(fh, amode);
    Post_MPI(MPI_File_get_amode_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Abort ================== */
_EXTERN_C_ int PMPI_Abort(MPI_Comm comm, int errorcode);
_EXTERN_C_ int MPI_Abort(MPI_Comm comm, int errorcode) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Abort(comm, errorcode);
    Post_MPI(MPI_Abort_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Grequest_complete ================== */
_EXTERN_C_ int PMPI_Grequest_complete(MPI_Request request);
_EXTERN_C_ int MPI_Grequest_complete(MPI_Request request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Grequest_complete(request);
    Post_MPI(MPI_Grequest_complete_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Pack ================== */
_EXTERN_C_ int PMPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outsize, int *position, MPI_Comm comm);
_EXTERN_C_ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outsize, int *position, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Pack(inbuf, incount, datatype, outbuf, outsize, position, comm);
    Post_MPI(MPI_Pack_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_set_attr ================== */
_EXTERN_C_ int PMPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val);
_EXTERN_C_ int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_set_attr(win, win_keyval, attribute_val);
    Post_MPI(MPI_Win_set_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_create ================== */
_EXTERN_C_ int PMPI_Info_create(MPI_Info *info);
_EXTERN_C_ int MPI_Info_create(MPI_Info *info) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_create(info);
    Post_MPI(MPI_Info_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_open ================== */
_EXTERN_C_ int PMPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh);
_EXTERN_C_ int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_open(comm, filename, amode, info, fh);
    Post_MPI(MPI_File_open_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_f90_complex ================== */
_EXTERN_C_ int PMPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_f90_complex(p, r, newtype);
    Post_MPI(MPI_Type_create_f90_complex_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Gatherv ================== */
_EXTERN_C_ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm);
_EXTERN_C_ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm);
    Post_MPI(MPI_Gatherv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_get_attr ================== */
_EXTERN_C_ int PMPI_Type_get_attr(MPI_Datatype type, int type_keyval, void *attribute_val, int *flag);
_EXTERN_C_ int MPI_Type_get_attr(MPI_Datatype type, int type_keyval, void *attribute_val, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_get_attr(type, type_keyval, attribute_val, flag);
    Post_MPI(MPI_Type_get_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_set_name ================== */
_EXTERN_C_ int PMPI_Comm_set_name(MPI_Comm comm, char *comm_name);
_EXTERN_C_ int MPI_Comm_set_name(MPI_Comm comm, char *comm_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_set_name(comm, comm_name);
    Post_MPI(MPI_Comm_set_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_disconnect ================== */
_EXTERN_C_ int PMPI_Comm_disconnect(MPI_Comm *comm);
_EXTERN_C_ int MPI_Comm_disconnect(MPI_Comm *comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_disconnect(comm);
    Post_MPI(MPI_Comm_disconnect_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_remote_group ================== */
_EXTERN_C_ int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group);
_EXTERN_C_ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_remote_group(comm, group);
    Post_MPI(MPI_Comm_remote_group_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_shift ================== */
_EXTERN_C_ int PMPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest);
_EXTERN_C_ int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_shift(comm, direction, disp, rank_source, rank_dest);
    Post_MPI(MPI_Cart_shift_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Init_thread ================== */
_EXTERN_C_ int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided);
_EXTERN_C_ int MPI_Init_thread(int *argc, char ***argv, int required, int *provided) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Init_thread(argc, argv, required, provided);
    Post_MPI(MPI_Init_thread_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_size ================== */
_EXTERN_C_ int PMPI_Comm_size(MPI_Comm comm, int *size);
_EXTERN_C_ int MPI_Comm_size(MPI_Comm comm, int *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_size(comm, size);
    Post_MPI(MPI_Comm_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_get_envelope ================== */
_EXTERN_C_ int PMPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner);
_EXTERN_C_ int MPI_Type_get_envelope(MPI_Datatype type, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_get_envelope(type, num_integers, num_addresses, num_datatypes, combiner);
    Post_MPI(MPI_Type_get_envelope_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_iread_shared ================== */
_EXTERN_C_ int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
_EXTERN_C_ int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_iread_shared(fh, buf, count, datatype, request);
    Post_MPI(MPI_File_iread_shared_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_set_errhandler ================== */
_EXTERN_C_ int PMPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler);
_EXTERN_C_ int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_set_errhandler(file, errhandler);
    Post_MPI(MPI_File_set_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Register_datarep ================== */
_EXTERN_C_ int PMPI_Register_datarep(char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state);
_EXTERN_C_ int MPI_Register_datarep(char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Register_datarep(datarep, read_conversion_fn, write_conversion_fn, dtype_file_extent_fn, extra_state);
    Post_MPI(MPI_Register_datarep_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_ordered ================== */
_EXTERN_C_ int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_ordered(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_read_ordered_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Init ================== */
_EXTERN_C_ int PMPI_Init(int *argc, char ***argv);
_EXTERN_C_ int MPI_Init(int *argc, char ***argv) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Init(argc, argv);
    Post_MPI(MPI_Init_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Waitsome ================== */
_EXTERN_C_ int PMPI_Waitsome(int incount, MPI_Request *array_of_requests, int *outcount, int *array_of_indices, MPI_Status *array_of_statuses);
_EXTERN_C_ int MPI_Waitsome(int incount, MPI_Request *array_of_requests, int *outcount, int *array_of_indices, MPI_Status *array_of_statuses) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Waitsome(incount, array_of_requests, outcount, array_of_indices, array_of_statuses);
    Post_MPI(MPI_Waitsome_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_difference ================== */
_EXTERN_C_ int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_difference(group1, group2, newgroup);
    Post_MPI(MPI_Group_difference_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Attr_get ================== */
_EXTERN_C_ int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
_EXTERN_C_ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Attr_get(comm, keyval, attribute_val, flag);
    Post_MPI(MPI_Attr_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Reduce_scatter ================== */
_EXTERN_C_ int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
_EXTERN_C_ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm);
    Post_MPI(MPI_Reduce_scatter_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_f90_real ================== */
_EXTERN_C_ int PMPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_f90_real(p, r, newtype);
    Post_MPI(MPI_Type_create_f90_real_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Wait ================== */
_EXTERN_C_ int PMPI_Wait(MPI_Request *request, MPI_Status *status);
_EXTERN_C_ int MPI_Wait(MPI_Request *request, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Wait(request, status);
    Post_MPI(MPI_Wait_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Testall ================== */
_EXTERN_C_ int PMPI_Testall(int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]);
_EXTERN_C_ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Testall(count, array_of_requests, flag, array_of_statuses);
    Post_MPI(MPI_Testall_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_incl ================== */
_EXTERN_C_ int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_incl(group, n, ranks, newgroup);
    Post_MPI(MPI_Group_incl_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Irsend ================== */
_EXTERN_C_ int PMPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Irsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Irsend(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Irsend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Scatterv ================== */
_EXTERN_C_ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
_EXTERN_C_ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
    Post_MPI(MPI_Scatterv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_call_errhandler ================== */
_EXTERN_C_ int PMPI_File_call_errhandler(MPI_File fh, int errorcode);
_EXTERN_C_ int MPI_File_call_errhandler(MPI_File fh, int errorcode) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_call_errhandler(fh, errorcode);
    Post_MPI(MPI_File_call_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_create_errhandler ================== */
_EXTERN_C_ int PMPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_create_errhandler(function, errhandler);
    Post_MPI(MPI_Comm_create_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Exscan ================== */
_EXTERN_C_ int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
_EXTERN_C_ int MPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Exscan(sendbuf, recvbuf, count, datatype, op, comm);
    Post_MPI(MPI_Exscan_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_all ================== */
_EXTERN_C_ int PMPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_all(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_write_all_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_connect ================== */
_EXTERN_C_ int PMPI_Comm_connect(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm);
_EXTERN_C_ int MPI_Comm_connect(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_connect(port_name, info, root, comm, newcomm);
    Post_MPI(MPI_Comm_connect_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_compare ================== */
_EXTERN_C_ int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result);
_EXTERN_C_ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_compare(group1, group2, result);
    Post_MPI(MPI_Group_compare_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Address ================== */
_EXTERN_C_ int PMPI_Address(void *location, MPI_Aint *address);
_EXTERN_C_ int MPI_Address(void *location, MPI_Aint *address) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Address(location, address);
    Post_MPI(MPI_Address_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_compare ================== */
_EXTERN_C_ int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result);
_EXTERN_C_ int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_compare(comm1, comm2, result);
    Post_MPI(MPI_Comm_compare_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Pack_external ================== */
_EXTERN_C_ int PMPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position);
_EXTERN_C_ int MPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Pack_external(datarep, inbuf, incount, datatype, outbuf, outsize, position);
    Post_MPI(MPI_Pack_external_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Request_free ================== */
_EXTERN_C_ int PMPI_Request_free(MPI_Request *request);
_EXTERN_C_ int MPI_Request_free(MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Request_free(request);
    Post_MPI(MPI_Request_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Topo_test ================== */
_EXTERN_C_ int PMPI_Topo_test(MPI_Comm comm, int *status);
_EXTERN_C_ int MPI_Topo_test(MPI_Comm comm, int *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Topo_test(comm, status);
    Post_MPI(MPI_Topo_test_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Irecv ================== */
_EXTERN_C_ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Irecv(buf, count, datatype, source, tag, comm, request);
    Post_MPI(MPI_Irecv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Query_thread ================== */
_EXTERN_C_ int PMPI_Query_thread(int *provided);
_EXTERN_C_ int MPI_Query_thread(int *provided) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Query_thread(provided);
    Post_MPI(MPI_Query_thread_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_call_errhandler ================== */
_EXTERN_C_ int PMPI_Win_call_errhandler(MPI_Win win, int errorcode);
_EXTERN_C_ int MPI_Win_call_errhandler(MPI_Win win, int errorcode) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_call_errhandler(win, errorcode);
    Post_MPI(MPI_Win_call_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_get_group ================== */
_EXTERN_C_ int PMPI_Win_get_group(MPI_Win win, MPI_Group *group);
_EXTERN_C_ int MPI_Win_get_group(MPI_Win win, MPI_Group *group) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_get_group(win, group);
    Post_MPI(MPI_Win_get_group_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Keyval_create ================== */
_EXTERN_C_ int PMPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state);
_EXTERN_C_ int MPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Keyval_create(copy_fn, delete_fn, keyval, extra_state);
    Post_MPI(MPI_Keyval_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Errhandler_create ================== */
_EXTERN_C_ int PMPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Errhandler_create(function, errhandler);
    Post_MPI(MPI_Errhandler_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_create ================== */
_EXTERN_C_ int PMPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart);
_EXTERN_C_ int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_create(old_comm, ndims, dims, periods, reorder, comm_cart);
    Post_MPI(MPI_Cart_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Status_set_cancelled ================== */
_EXTERN_C_ int PMPI_Status_set_cancelled(MPI_Status *status, int flag);
_EXTERN_C_ int MPI_Status_set_cancelled(MPI_Status *status, int flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Status_set_cancelled(status, flag);
    Post_MPI(MPI_Status_set_cancelled_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_get_attr ================== */
_EXTERN_C_ int PMPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag);
_EXTERN_C_ int MPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_get_attr(win, win_keyval, attribute_val, flag);
    Post_MPI(MPI_Win_get_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_struct ================== */
_EXTERN_C_ int PMPI_Type_struct(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_struct(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_struct(count, array_of_blocklengths, array_of_displacements, array_of_types, newtype);
    Post_MPI(MPI_Type_struct_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Graph_neighbors_count ================== */
_EXTERN_C_ int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors);
_EXTERN_C_ int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Graph_neighbors_count(comm, rank, nneighbors);
    Post_MPI(MPI_Graph_neighbors_count_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_view ================== */
_EXTERN_C_ int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep);
_EXTERN_C_ int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_view(fh, disp, etype, filetype, datarep);
    Post_MPI(MPI_File_get_view_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Allgatherv ================== */
_EXTERN_C_ int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm);
_EXTERN_C_ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
    Post_MPI(MPI_Allgatherv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Sendrecv ================== */
_EXTERN_C_ int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status);
_EXTERN_C_ int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, source, recvtag, comm, status);
    Post_MPI(MPI_Sendrecv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_position_shared ================== */
_EXTERN_C_ int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset);
_EXTERN_C_ int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_position_shared(fh, offset);
    Post_MPI(MPI_File_get_position_shared_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Graph_neighbors ================== */
_EXTERN_C_ int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int *neighbors);
_EXTERN_C_ int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int *neighbors) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Graph_neighbors(comm, rank, maxneighbors, neighbors);
    Post_MPI(MPI_Graph_neighbors_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_rank ================== */
_EXTERN_C_ int PMPI_Group_rank(MPI_Group group, int *rank);
_EXTERN_C_ int MPI_Group_rank(MPI_Group group, int *rank) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_rank(group, rank);
    Post_MPI(MPI_Group_rank_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Dims_create ================== */
_EXTERN_C_ int PMPI_Dims_create(int nnodes, int ndims, int *dims);
_EXTERN_C_ int MPI_Dims_create(int nnodes, int ndims, int *dims) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Dims_create(nnodes, ndims, dims);
    Post_MPI(MPI_Dims_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_iread ================== */
_EXTERN_C_ int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
_EXTERN_C_ int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_iread(fh, buf, count, datatype, request);
    Post_MPI(MPI_File_iread_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Scatter ================== */
_EXTERN_C_ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
_EXTERN_C_ int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
    Post_MPI(MPI_Scatter_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_set_attr ================== */
_EXTERN_C_ int PMPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val);
_EXTERN_C_ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_set_attr(comm, comm_keyval, attribute_val);
    Post_MPI(MPI_Comm_set_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_free_keyval ================== */
_EXTERN_C_ int PMPI_Comm_free_keyval(int *comm_keyval);
_EXTERN_C_ int MPI_Comm_free_keyval(int *comm_keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_free_keyval(comm_keyval);
    Post_MPI(MPI_Comm_free_keyval_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Op_create ================== */
_EXTERN_C_ int PMPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op);
_EXTERN_C_ int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Op_create(function, commute, op);
    Post_MPI(MPI_Op_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_seek ================== */
_EXTERN_C_ int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
_EXTERN_C_ int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_seek(fh, offset, whence);
    Post_MPI(MPI_File_seek_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Test_cancelled ================== */
_EXTERN_C_ int PMPI_Test_cancelled(MPI_Status *status, int *flag);
_EXTERN_C_ int MPI_Test_cancelled(MPI_Status *status, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Test_cancelled(status, flag);
    Post_MPI(MPI_Test_cancelled_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Ssend_init ================== */
_EXTERN_C_ int PMPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Ssend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Ssend_init(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Ssend_init_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Rsend_init ================== */
_EXTERN_C_ int PMPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Rsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Rsend_init(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Rsend_init_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_free ================== */
_EXTERN_C_ int PMPI_Info_free(MPI_Info *info);
_EXTERN_C_ int MPI_Info_free(MPI_Info *info) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_free(info);
    Post_MPI(MPI_Info_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Publish_name ================== */
_EXTERN_C_ int PMPI_Publish_name(char *service_name, MPI_Info info, char *port_name);
_EXTERN_C_ int MPI_Publish_name(char *service_name, MPI_Info info, char *port_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Publish_name(service_name, info, port_name);
    Post_MPI(MPI_Publish_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Bcast ================== */
_EXTERN_C_ int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
_EXTERN_C_ int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Bcast(buffer, count, datatype, root, comm);
    Post_MPI(MPI_Bcast_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Get_processor_name ================== */
_EXTERN_C_ int PMPI_Get_processor_name(char *name, int *resultlen);
_EXTERN_C_ int MPI_Get_processor_name(char *name, int *resultlen) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Get_processor_name(name, resultlen);
    Post_MPI(MPI_Get_processor_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_get_extent ================== */
_EXTERN_C_ int PMPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent);
_EXTERN_C_ int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_get_extent(type, lb, extent);
    Post_MPI(MPI_Type_get_extent_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_ordered_end ================== */
_EXTERN_C_ int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_ordered_end(fh, buf, status);
    Post_MPI(MPI_File_write_ordered_end_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Get_version ================== */
_EXTERN_C_ int PMPI_Get_version(int *version, int *subversion);
_EXTERN_C_ int MPI_Get_version(int *version, int *subversion) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Get_version(version, subversion);
    Post_MPI(MPI_Get_version_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Graph_create ================== */
_EXTERN_C_ int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph);
_EXTERN_C_ int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges, int reorder, MPI_Comm *comm_graph) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Graph_create(comm_old, nnodes, index, edges, reorder, comm_graph);
    Post_MPI(MPI_Graph_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Put ================== */
_EXTERN_C_ int PMPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win);
_EXTERN_C_ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Put(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win);
    Post_MPI(MPI_Put_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_at_all ================== */
_EXTERN_C_ int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_at_all(fh, offset, buf, count, datatype, status);
    Post_MPI(MPI_File_write_at_all_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Errhandler_get ================== */
_EXTERN_C_ int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Errhandler_get(comm, errhandler);
    Post_MPI(MPI_Errhandler_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Pack_size ================== */
_EXTERN_C_ int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size);
_EXTERN_C_ int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Pack_size(incount, datatype, comm, size);
    Post_MPI(MPI_Pack_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Ibsend ================== */
_EXTERN_C_ int PMPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Ibsend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Ibsend(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Ibsend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_test_inter ================== */
_EXTERN_C_ int PMPI_Comm_test_inter(MPI_Comm comm, int *flag);
_EXTERN_C_ int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_test_inter(comm, flag);
    Post_MPI(MPI_Comm_test_inter_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Intercomm_merge ================== */
_EXTERN_C_ int PMPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintercomm);
_EXTERN_C_ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintercomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Intercomm_merge(intercomm, high, newintercomm);
    Post_MPI(MPI_Intercomm_merge_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_complete ================== */
_EXTERN_C_ int PMPI_Win_complete(MPI_Win win);
_EXTERN_C_ int MPI_Win_complete(MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_complete(win);
    Post_MPI(MPI_Win_complete_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_type_extent ================== */
_EXTERN_C_ int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent);
_EXTERN_C_ int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_type_extent(fh, datatype, extent);
    Post_MPI(MPI_File_get_type_extent_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Graph_map ================== */
_EXTERN_C_ int PMPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, int *newrank);
_EXTERN_C_ int MPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, int *newrank) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Graph_map(comm, nnodes, index, edges, newrank);
    Post_MPI(MPI_Graph_map_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_all_begin ================== */
_EXTERN_C_ int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype);
_EXTERN_C_ int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_all_begin(fh, buf, count, datatype);
    Post_MPI(MPI_File_read_all_begin_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_get_valuelen ================== */
_EXTERN_C_ int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag);
_EXTERN_C_ int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_get_valuelen(info, key, valuelen, flag);
    Post_MPI(MPI_Info_get_valuelen_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_set ================== */
_EXTERN_C_ int PMPI_Info_set(MPI_Info info, char *key, char *value);
_EXTERN_C_ int MPI_Info_set(MPI_Info info, char *key, char *value) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_set(info, key, value);
    Post_MPI(MPI_Info_set_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_at_all ================== */
_EXTERN_C_ int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_at_all(fh, offset, buf, count, datatype, status);
    Post_MPI(MPI_File_read_at_all_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_ordered_end ================== */
_EXTERN_C_ int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_ordered_end(fh, buf, status);
    Post_MPI(MPI_File_read_ordered_end_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Isend ================== */
_EXTERN_C_ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Isend(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Isend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_set_attr ================== */
_EXTERN_C_ int PMPI_Type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val);
_EXTERN_C_ int MPI_Type_set_attr(MPI_Datatype type, int type_keyval, void *attr_val) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_set_attr(type, type_keyval, attr_val);
    Post_MPI(MPI_Type_set_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_union ================== */
_EXTERN_C_ int PMPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_union(group1, group2, newgroup);
    Post_MPI(MPI_Group_union_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Alltoall ================== */
_EXTERN_C_ int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
_EXTERN_C_ int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
    Post_MPI(MPI_Alltoall_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_sub ================== */
_EXTERN_C_ int PMPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm);
_EXTERN_C_ int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_sub(comm, remain_dims, new_comm);
    Post_MPI(MPI_Cart_sub_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_get ================== */
_EXTERN_C_ int PMPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag);
_EXTERN_C_ int MPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_get(info, key, valuelen, value, flag);
    Post_MPI(MPI_Info_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Start ================== */
_EXTERN_C_ int PMPI_Start(MPI_Request *request);
_EXTERN_C_ int MPI_Start(MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Start(request);
    Post_MPI(MPI_Start_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_spawn_multiple ================== */
_EXTERN_C_ int PMPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, int *array_of_maxprocs, MPI_Info *array_of_info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes);
_EXTERN_C_ int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, int *array_of_maxprocs, MPI_Info *array_of_info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_spawn_multiple(count, array_of_commands, array_of_argv, array_of_maxprocs, array_of_info, root, comm, intercomm, array_of_errcodes);
    Post_MPI(MPI_Comm_spawn_multiple_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_intersection ================== */
_EXTERN_C_ int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_intersection(group1, group2, newgroup);
    Post_MPI(MPI_Group_intersection_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_free_keyval ================== */
_EXTERN_C_ int PMPI_Type_free_keyval(int *type_keyval);
_EXTERN_C_ int MPI_Type_free_keyval(int *type_keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_free_keyval(type_keyval);
    Post_MPI(MPI_Type_free_keyval_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Pcontrol ================== */
_EXTERN_C_ int PMPI_Pcontrol(const int level, ...);
_EXTERN_C_ int MPI_Pcontrol(const int level, ...) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Pcontrol(level);
    Post_MPI(MPI_Pcontrol_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_get_contents ================== */
_EXTERN_C_ int PMPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int max_addresses, int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]);
_EXTERN_C_ int MPI_Type_get_contents(MPI_Datatype mtype, int max_integers, int max_addresses, int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[], MPI_Datatype array_of_datatypes[]) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_get_contents(mtype, max_integers, max_addresses, max_datatypes, array_of_integers, array_of_addresses, array_of_datatypes);
    Post_MPI(MPI_Type_get_contents_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_free ================== */
_EXTERN_C_ int PMPI_Type_free(MPI_Datatype *type);
_EXTERN_C_ int MPI_Type_free(MPI_Datatype *type) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_free(type);
    Post_MPI(MPI_Type_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_get_nthkey ================== */
_EXTERN_C_ int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key);
_EXTERN_C_ int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_get_nthkey(info, n, key);
    Post_MPI(MPI_Info_get_nthkey_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_at_all_begin ================== */
_EXTERN_C_ int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype);
_EXTERN_C_ int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_at_all_begin(fh, offset, buf, count, datatype);
    Post_MPI(MPI_File_write_at_all_begin_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Unpack_external ================== */
_EXTERN_C_ int PMPI_Unpack_external(char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype);
_EXTERN_C_ int MPI_Unpack_external(char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Unpack_external(datarep, inbuf, insize, position, outbuf, outcount, datatype);
    Post_MPI(MPI_Unpack_external_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Errhandler_set ================== */
_EXTERN_C_ int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
_EXTERN_C_ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Errhandler_set(comm, errhandler);
    Post_MPI(MPI_Errhandler_set_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_at_all_begin ================== */
_EXTERN_C_ int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype);
_EXTERN_C_ int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_at_all_begin(fh, offset, buf, count, datatype);
    Post_MPI(MPI_File_read_at_all_begin_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_iwrite_at ================== */
_EXTERN_C_ int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
_EXTERN_C_ int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_iwrite_at(fh, offset, buf, count, datatype, request);
    Post_MPI(MPI_File_iwrite_at_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_lock ================== */
_EXTERN_C_ int PMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win);
_EXTERN_C_ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_lock(lock_type, rank, assert, win);
    Post_MPI(MPI_Win_lock_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_unlock ================== */
_EXTERN_C_ int PMPI_Win_unlock(int rank, MPI_Win win);
_EXTERN_C_ int MPI_Win_unlock(int rank, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_unlock(rank, win);
    Post_MPI(MPI_Win_unlock_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Test ================== */
_EXTERN_C_ int PMPI_Test(MPI_Request *request, int *flag, MPI_Status *status);
_EXTERN_C_ int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Test(request, flag, status);
    Post_MPI(MPI_Test_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_all_end ================== */
_EXTERN_C_ int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_all_end(fh, buf, status);
    Post_MPI(MPI_File_write_all_end_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_get_nkeys ================== */
_EXTERN_C_ int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys);
_EXTERN_C_ int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_get_nkeys(info, nkeys);
    Post_MPI(MPI_Info_get_nkeys_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_start ================== */
_EXTERN_C_ int PMPI_Win_start(MPI_Group group, int assert, MPI_Win win);
_EXTERN_C_ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_start(group, assert, win);
    Post_MPI(MPI_Win_start_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_size ================== */
_EXTERN_C_ int PMPI_File_get_size(MPI_File fh, MPI_Offset *size);
_EXTERN_C_ int MPI_File_get_size(MPI_File fh, MPI_Offset *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_size(fh, size);
    Post_MPI(MPI_File_get_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Finalized ================== */
_EXTERN_C_ int PMPI_Finalized(int *flag);
_EXTERN_C_ int MPI_Finalized(int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Finalized(flag);
    Post_MPI(MPI_Finalized_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_free_keyval ================== */
_EXTERN_C_ int PMPI_Win_free_keyval(int *win_keyval);
_EXTERN_C_ int MPI_Win_free_keyval(int *win_keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_free_keyval(win_keyval);
    Post_MPI(MPI_Win_free_keyval_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Waitany ================== */
_EXTERN_C_ int PMPI_Waitany(int count, MPI_Request *array_of_requests, int *index, MPI_Status *status);
_EXTERN_C_ int MPI_Waitany(int count, MPI_Request *array_of_requests, int *index, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Waitany(count, array_of_requests, index, status);
    Post_MPI(MPI_Waitany_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Open_port ================== */
_EXTERN_C_ int PMPI_Open_port(MPI_Info info, char *port_name);
_EXTERN_C_ int MPI_Open_port(MPI_Info info, char *port_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Open_port(info, port_name);
    Post_MPI(MPI_Open_port_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_indexed ================== */
_EXTERN_C_ int PMPI_Type_indexed(int count, int array_of_blocklengths[], int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_indexed(int count, int array_of_blocklengths[], int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_indexed(count, array_of_blocklengths, array_of_displacements, oldtype, newtype);
    Post_MPI(MPI_Type_indexed_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Send_init ================== */
_EXTERN_C_ int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Send_init(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Send_init_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Gather ================== */
_EXTERN_C_ int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
_EXTERN_C_ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
    Post_MPI(MPI_Gather_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Get_elements ================== */
_EXTERN_C_ int PMPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count);
_EXTERN_C_ int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Get_elements(status, datatype, count);
    Post_MPI(MPI_Get_elements_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write ================== */
_EXTERN_C_ int PMPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_write_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_at_all_end ================== */
_EXTERN_C_ int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_at_all_end(fh, buf, status);
    Post_MPI(MPI_File_read_at_all_end_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Probe ================== */
_EXTERN_C_ int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
_EXTERN_C_ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Probe(source, tag, comm, status);
    Post_MPI(MPI_Probe_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Send ================== */
_EXTERN_C_ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
_EXTERN_C_ int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Send(buf, count, datatype, dest, tag, comm);
    Post_MPI(MPI_Send_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Unpack ================== */
_EXTERN_C_ int PMPI_Unpack(void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm);
_EXTERN_C_ int MPI_Unpack(void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Unpack(inbuf, insize, position, outbuf, outcount, datatype, comm);
    Post_MPI(MPI_Unpack_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_ub ================== */
_EXTERN_C_ int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub);
_EXTERN_C_ int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_ub(mtype, ub);
    Post_MPI(MPI_Type_ub_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Status_set_elements ================== */
_EXTERN_C_ int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count);
_EXTERN_C_ int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Status_set_elements(status, datatype, count);
    Post_MPI(MPI_Status_set_elements_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_delete_attr ================== */
_EXTERN_C_ int PMPI_Win_delete_attr(MPI_Win win, int win_keyval);
_EXTERN_C_ int MPI_Win_delete_attr(MPI_Win win, int win_keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_delete_attr(win, win_keyval);
    Post_MPI(MPI_Win_delete_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Testany ================== */
_EXTERN_C_ int PMPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status);
_EXTERN_C_ int MPI_Testany(int count, MPI_Request array_of_requests[], int *index, int *flag, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Testany(count, array_of_requests, index, flag, status);
    Post_MPI(MPI_Testany_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_set_atomicity ================== */
_EXTERN_C_ int PMPI_File_set_atomicity(MPI_File fh, int flag);
_EXTERN_C_ int MPI_File_set_atomicity(MPI_File fh, int flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_set_atomicity(fh, flag);
    Post_MPI(MPI_File_set_atomicity_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_range_incl ================== */
_EXTERN_C_ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_range_incl(group, n, ranges, newgroup);
    Post_MPI(MPI_Group_range_incl_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Get ================== */
_EXTERN_C_ int PMPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win);
_EXTERN_C_ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Get(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win);
    Post_MPI(MPI_Get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_vector ================== */
_EXTERN_C_ int PMPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_vector(count, blocklength, stride, oldtype, newtype);
    Post_MPI(MPI_Type_vector_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_at_all_end ================== */
_EXTERN_C_ int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_at_all_end(fh, buf, status);
    Post_MPI(MPI_File_write_at_all_end_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_get_true_extent ================== */
_EXTERN_C_ int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
_EXTERN_C_ int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_get_true_extent(datatype, true_lb, true_extent);
    Post_MPI(MPI_Type_get_true_extent_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Graph_get ================== */
_EXTERN_C_ int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges);
_EXTERN_C_ int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Graph_get(comm, maxindex, maxedges, index, edges);
    Post_MPI(MPI_Graph_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Info_delete ================== */
_EXTERN_C_ int PMPI_Info_delete(MPI_Info info, char *key);
_EXTERN_C_ int MPI_Info_delete(MPI_Info info, char *key) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Info_delete(info, key);
    Post_MPI(MPI_Info_delete_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_spawn ================== */
_EXTERN_C_ int PMPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes);
_EXTERN_C_ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int *array_of_errcodes) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_spawn(command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes);
    Post_MPI(MPI_Comm_spawn_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_rank ================== */
_EXTERN_C_ int PMPI_Cart_rank(MPI_Comm comm, int *coords, int *rank);
_EXTERN_C_ int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_rank(comm, coords, rank);
    Post_MPI(MPI_Cart_rank_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Finalize ================== */
_EXTERN_C_ int PMPI_Finalize();
_EXTERN_C_ int MPI_Finalize() { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Finalize();
    Post_MPI(MPI_Finalize_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_create ================== */
_EXTERN_C_ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm);
_EXTERN_C_ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_create(comm, group, newcomm);
    Post_MPI(MPI_Comm_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Pack_external_size ================== */
_EXTERN_C_ int PMPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size);
_EXTERN_C_ int MPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Pack_external_size(datarep, incount, datatype, size);
    Post_MPI(MPI_Pack_external_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_join ================== */
_EXTERN_C_ int PMPI_Comm_join(int fd, MPI_Comm *intercomm);
_EXTERN_C_ int MPI_Comm_join(int fd, MPI_Comm *intercomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_join(fd, intercomm);
    Post_MPI(MPI_Comm_join_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_shared ================== */
_EXTERN_C_ int PMPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_shared(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_read_shared_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Keyval_free ================== */
_EXTERN_C_ int PMPI_Keyval_free(int *keyval);
_EXTERN_C_ int MPI_Keyval_free(int *keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Keyval_free(keyval);
    Post_MPI(MPI_Keyval_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_wait ================== */
_EXTERN_C_ int PMPI_Win_wait(MPI_Win win);
_EXTERN_C_ int MPI_Win_wait(MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_wait(win);
    Post_MPI(MPI_Win_wait_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Alloc_mem ================== */
_EXTERN_C_ int PMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr);
_EXTERN_C_ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Alloc_mem(size, info, baseptr);
    Post_MPI(MPI_Alloc_mem_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_size ================== */
_EXTERN_C_ int PMPI_Type_size(MPI_Datatype type, int *size);
_EXTERN_C_ int MPI_Type_size(MPI_Datatype type, int *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_size(type, size);
    Post_MPI(MPI_Type_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Lookup_name ================== */
_EXTERN_C_ int PMPI_Lookup_name(char *service_name, MPI_Info info, char *port_name);
_EXTERN_C_ int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Lookup_name(service_name, info, port_name);
    Post_MPI(MPI_Lookup_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_atomicity ================== */
_EXTERN_C_ int PMPI_File_get_atomicity(MPI_File fh, int *flag);
_EXTERN_C_ int MPI_File_get_atomicity(MPI_File fh, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_atomicity(fh, flag);
    Post_MPI(MPI_File_get_atomicity_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_get_name ================== */
_EXTERN_C_ int PMPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen);
_EXTERN_C_ int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_get_name(win, win_name, resultlen);
    Post_MPI(MPI_Win_get_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_darray ================== */
_EXTERN_C_ int PMPI_Type_create_darray(int size, int rank, int ndims, int gsize_array[], int distrib_array[], int darg_array[], int psize_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_darray(int size, int rank, int ndims, int gsize_array[], int distrib_array[], int darg_array[], int psize_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_darray(size, rank, ndims, gsize_array, distrib_array, darg_array, psize_array, order, oldtype, newtype);
    Post_MPI(MPI_Type_create_darray_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_hindexed ================== */
_EXTERN_C_ int PMPI_Type_create_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_hindexed(int count, int array_of_blocklengths[], MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_hindexed(count, array_of_blocklengths, array_of_displacements, oldtype, newtype);
    Post_MPI(MPI_Type_create_hindexed_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_create_errhandler ================== */
_EXTERN_C_ int PMPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_create_errhandler(function, errhandler);
    Post_MPI(MPI_Win_create_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cart_map ================== */
_EXTERN_C_ int PMPI_Cart_map(MPI_Comm comm, int ndims, int *dims, int *periods, int *newrank);
_EXTERN_C_ int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, int *periods, int *newrank) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cart_map(comm, ndims, dims, periods, newrank);
    Post_MPI(MPI_Cart_map_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_at ================== */
_EXTERN_C_ int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_at(fh, offset, buf, count, datatype, status);
    Post_MPI(MPI_File_write_at_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_accept ================== */
_EXTERN_C_ int PMPI_Comm_accept(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm);
_EXTERN_C_ int MPI_Comm_accept(char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_accept(port_name, info, root, comm, newcomm);
    Post_MPI(MPI_Comm_accept_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_struct ================== */
_EXTERN_C_ int PMPI_Type_create_struct(int count, int array_of_block_lengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_struct(int count, int array_of_block_lengths[], MPI_Aint array_of_displacements[], MPI_Datatype array_of_types[], MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_struct(count, array_of_block_lengths, array_of_displacements, array_of_types, newtype);
    Post_MPI(MPI_Type_create_struct_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Wtick ================== */
_EXTERN_C_ double PMPI_Wtick();
_EXTERN_C_ double MPI_Wtick() { 
    double _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Wtick();
    Post_MPI(MPI_Wtick_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_set_info ================== */
_EXTERN_C_ int PMPI_File_set_info(MPI_File fh, MPI_Info info);
_EXTERN_C_ int MPI_File_set_info(MPI_File fh, MPI_Info info) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_set_info(fh, info);
    Post_MPI(MPI_File_set_info_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Close_port ================== */
_EXTERN_C_ int PMPI_Close_port(char *port_name);
_EXTERN_C_ int MPI_Close_port(char *port_name) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Close_port(port_name);
    Post_MPI(MPI_Close_port_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_byte_offset ================== */
_EXTERN_C_ int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp);
_EXTERN_C_ int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_byte_offset(fh, offset, disp);
    Post_MPI(MPI_File_get_byte_offset_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_f90_integer ================== */
_EXTERN_C_ int PMPI_Type_create_f90_integer(int r, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_f90_integer(r, newtype);
    Post_MPI(MPI_Type_create_f90_integer_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_subarray ================== */
_EXTERN_C_ int PMPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], int start_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_subarray(int ndims, int size_array[], int subsize_array[], int start_array[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_subarray(ndims, size_array, subsize_array, start_array, order, oldtype, newtype);
    Post_MPI(MPI_Type_create_subarray_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_delete ================== */
_EXTERN_C_ int PMPI_File_delete(char *filename, MPI_Info info);
_EXTERN_C_ int MPI_File_delete(char *filename, MPI_Info info) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_delete(filename, info);
    Post_MPI(MPI_File_delete_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_close ================== */
_EXTERN_C_ int PMPI_File_close(MPI_File *fh);
_EXTERN_C_ int MPI_File_close(MPI_File *fh) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_close(fh);
    Post_MPI(MPI_File_close_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_create ================== */
_EXTERN_C_ int PMPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win);
_EXTERN_C_ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_create(base, size, disp_unit, info, comm, win);
    Post_MPI(MPI_Win_create_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_all ================== */
_EXTERN_C_ int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_all(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_read_all_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_call_errhandler ================== */
_EXTERN_C_ int PMPI_Comm_call_errhandler(MPI_Comm comm, int errorcode);
_EXTERN_C_ int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_call_errhandler(comm, errorcode);
    Post_MPI(MPI_Comm_call_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Recv ================== */
_EXTERN_C_ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status);
_EXTERN_C_ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Recv(buf, count, datatype, source, tag, comm, status);
    Post_MPI(MPI_Recv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_dup ================== */
_EXTERN_C_ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm);
_EXTERN_C_ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_dup(comm, newcomm);
    Post_MPI(MPI_Comm_dup_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Waitall ================== */
_EXTERN_C_ int PMPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses);
_EXTERN_C_ int MPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Waitall(count, array_of_requests, array_of_statuses);
    Post_MPI(MPI_Waitall_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_delete_attr ================== */
_EXTERN_C_ int PMPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval);
_EXTERN_C_ int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_delete_attr(comm, comm_keyval);
    Post_MPI(MPI_Comm_delete_attr_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Ssend ================== */
_EXTERN_C_ int PMPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
_EXTERN_C_ int MPI_Ssend(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Ssend(buf, count, datatype, dest, tag, comm);
    Post_MPI(MPI_Ssend_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_size ================== */
_EXTERN_C_ int PMPI_Group_size(MPI_Group group, int *size);
_EXTERN_C_ int MPI_Group_size(MPI_Group group, int *size) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_size(group, size);
    Post_MPI(MPI_Group_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_get_errhandler ================== */
_EXTERN_C_ int PMPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_get_errhandler(file, errhandler);
    Post_MPI(MPI_File_get_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Attr_put ================== */
_EXTERN_C_ int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val);
_EXTERN_C_ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Attr_put(comm, keyval, attribute_val);
    Post_MPI(MPI_Attr_put_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Barrier ================== */
_EXTERN_C_ int PMPI_Barrier(MPI_Comm comm);
_EXTERN_C_ int MPI_Barrier(MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Barrier(comm);
    Post_MPI(MPI_Barrier_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_free ================== */
_EXTERN_C_ int PMPI_Win_free(MPI_Win *win);
_EXTERN_C_ int MPI_Win_free(MPI_Win *win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_free(win);
    Post_MPI(MPI_Win_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Alltoallw ================== */
_EXTERN_C_ int PMPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm);
_EXTERN_C_ int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm);
    Post_MPI(MPI_Alltoallw_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Alltoallv ================== */
_EXTERN_C_ int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm);
_EXTERN_C_ int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Alltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm);
    Post_MPI(MPI_Alltoallv_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Bsend_init ================== */
_EXTERN_C_ int PMPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
_EXTERN_C_ int MPI_Bsend_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Bsend_init(buf, count, datatype, dest, tag, comm, request);
    Post_MPI(MPI_Bsend_init_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Add_error_string ================== */
_EXTERN_C_ int PMPI_Add_error_string(int errorcode, char *string);
_EXTERN_C_ int MPI_Add_error_string(int errorcode, char *string) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Add_error_string(errorcode, string);
    Post_MPI(MPI_Add_error_string_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Op_free ================== */
_EXTERN_C_ int PMPI_Op_free(MPI_Op *op);
_EXTERN_C_ int MPI_Op_free(MPI_Op *op) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Op_free(op);
    Post_MPI(MPI_Op_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_set_errhandler ================== */
_EXTERN_C_ int PMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler);
_EXTERN_C_ int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_set_errhandler(win, errhandler);
    Post_MPI(MPI_Win_set_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Accumulate ================== */
_EXTERN_C_ int PMPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
_EXTERN_C_ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Accumulate(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win);
    Post_MPI(MPI_Accumulate_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_get_name ================== */
_EXTERN_C_ int PMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen);
_EXTERN_C_ int MPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_get_name(comm, comm_name, resultlen);
    Post_MPI(MPI_Comm_get_name_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_create_errhandler ================== */
_EXTERN_C_ int PMPI_File_create_errhandler(MPI_File_errhandler_fn *function, MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_create_errhandler(function, errhandler);
    Post_MPI(MPI_File_create_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_ordered ================== */
_EXTERN_C_ int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_write_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_ordered(fh, buf, count, datatype, status);
    Post_MPI(MPI_File_write_ordered_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_range_excl ================== */
_EXTERN_C_ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup);
_EXTERN_C_ int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_range_excl(group, n, ranges, newgroup);
    Post_MPI(MPI_Group_range_excl_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_split ================== */
_EXTERN_C_ int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm);
_EXTERN_C_ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_split(comm, color, key, newcomm);
    Post_MPI(MPI_Comm_split_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_set_errhandler ================== */
_EXTERN_C_ int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler);
_EXTERN_C_ int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_set_errhandler(comm, errhandler);
    Post_MPI(MPI_Comm_set_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Request_get_status ================== */
_EXTERN_C_ int PMPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status);
_EXTERN_C_ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Request_get_status(request, flag, status);
    Post_MPI(MPI_Request_get_status_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Group_free ================== */
_EXTERN_C_ int PMPI_Group_free(MPI_Group *group);
_EXTERN_C_ int MPI_Group_free(MPI_Group *group) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Group_free(group);
    Post_MPI(MPI_Group_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_keyval ================== */
_EXTERN_C_ int PMPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, MPI_Type_delete_attr_function *type_delete_attr_fn, int *type_keyval, void *extra_state);
_EXTERN_C_ int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, MPI_Type_delete_attr_function *type_delete_attr_fn, int *type_keyval, void *extra_state) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_keyval(type_copy_attr_fn, type_delete_attr_fn, type_keyval, extra_state);
    Post_MPI(MPI_Type_create_keyval_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_write_ordered_begin ================== */
_EXTERN_C_ int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype);
_EXTERN_C_ int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_write_ordered_begin(fh, buf, count, datatype);
    Post_MPI(MPI_File_write_ordered_begin_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_ordered_begin ================== */
_EXTERN_C_ int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype);
_EXTERN_C_ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_ordered_begin(fh, buf, count, datatype);
    Post_MPI(MPI_File_read_ordered_begin_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Iprobe ================== */
_EXTERN_C_ int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status);
_EXTERN_C_ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Iprobe(source, tag, comm, flag, status);
    Post_MPI(MPI_Iprobe_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_rank ================== */
_EXTERN_C_ int PMPI_Comm_rank(MPI_Comm comm, int *rank);
_EXTERN_C_ int MPI_Comm_rank(MPI_Comm comm, int *rank) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_rank(comm, rank);
    Post_MPI(MPI_Comm_rank_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Comm_get_errhandler ================== */
_EXTERN_C_ int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler);
_EXTERN_C_ int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *erhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Comm_get_errhandler(comm, erhandler);
    Post_MPI(MPI_Comm_get_errhandler_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Cancel ================== */
_EXTERN_C_ int PMPI_Cancel(MPI_Request *request);
_EXTERN_C_ int MPI_Cancel(MPI_Request *request) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Cancel(request);
    Post_MPI(MPI_Cancel_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_fence ================== */
_EXTERN_C_ int PMPI_Win_fence(int assert, MPI_Win win);
_EXTERN_C_ int MPI_Win_fence(int assert, MPI_Win win) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_fence(assert, win);
    Post_MPI(MPI_Win_fence_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_create_keyval ================== */
_EXTERN_C_ int PMPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, MPI_Win_delete_attr_function *win_delete_attr_fn, int *win_keyval, void *extra_state);
_EXTERN_C_ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, MPI_Win_delete_attr_function *win_delete_attr_fn, int *win_keyval, void *extra_state) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_create_keyval(win_copy_attr_fn, win_delete_attr_fn, win_keyval, extra_state);
    Post_MPI(MPI_Win_create_keyval_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Errhandler_free ================== */
_EXTERN_C_ int PMPI_Errhandler_free(MPI_Errhandler *errhandler);
_EXTERN_C_ int MPI_Errhandler_free(MPI_Errhandler *errhandler) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Errhandler_free(errhandler);
    Post_MPI(MPI_Errhandler_free_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Win_test ================== */
_EXTERN_C_ int PMPI_Win_test(MPI_Win win, int *flag);
_EXTERN_C_ int MPI_Win_test(MPI_Win win, int *flag) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Win_test(win, flag);
    Post_MPI(MPI_Win_test_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_File_read_at ================== */
_EXTERN_C_ int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
_EXTERN_C_ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_File_read_at(fh, offset, buf, count, datatype, status);
    Post_MPI(MPI_File_read_at_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_match_size ================== */
_EXTERN_C_ int PMPI_Type_match_size(int typeclass, int size, MPI_Datatype *type);
_EXTERN_C_ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_match_size(typeclass, size, type);
    Post_MPI(MPI_Type_match_size_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Graphdims_get ================== */
_EXTERN_C_ int PMPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges);
_EXTERN_C_ int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Graphdims_get(comm, nnodes, nedges);
    Post_MPI(MPI_Graphdims_get_Counter);
    
    return _wrap_py_return_val;
}

/* ================== C Wrappers for MPI_Type_create_hvector ================== */
_EXTERN_C_ int PMPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
_EXTERN_C_ int MPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype) { 
    int _wrap_py_return_val = 0;

    Pre_MPI();
    _wrap_py_return_val = PMPI_Type_create_hvector(count, blocklength, stride, oldtype, newtype);
    Post_MPI(MPI_Type_create_hvector_Counter);
    
    return _wrap_py_return_val;
}


